import 'package:card_swiper/card_swiper.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:window_example/interface/content_page.dart';

class BannerContent extends ContentPage {
  @override
  Widget getContent() {
    return const BannerWidget();
  }
}

var images = [
  'assets/images/bg0.jpeg',
  'assets/images/bg1.jpeg',
  'assets/images/bg2.jpeg',
];




class BannerWidget extends StatefulWidget {
  const BannerWidget({super.key});

  @override
  State<BannerWidget> createState() => _BannerWidgetState();
}

class _BannerWidgetState extends State<BannerWidget> {
  @override
  Widget build(BuildContext context) {
    // return Text("Banner");
    return Swiper(
        itemBuilder: (context, index) {
          final image = images[index];
          return Image.asset(
            image,
            fit: BoxFit.cover,
          );
        },
        indicatorLayout: PageIndicatorLayout.COLOR,
        autoplay: false,
        itemCount: images.length,
        // pagination: const SwiperPagination(
        //     builder:(
        //         size: Size(10, 4),
        //         activeSize: Size(15, 4),
        //         color: Colors.blueAccent,
        //         activeColor: Colors.red)),
        // control: const SwiperControl(),
        pagination: const SwiperPagination(),
        outer: false,
        itemHeight: 200,
        itemWidth: 350,
        scrollDirection: Axis.horizontal,
        autoplayDisableOnInteraction: false,
        layout: SwiperLayout.DEFAULT);
  }
}
